package com.dt.platform.domain.oa;

import com.github.foxnic.dao.entity.Entity;
import io.swagger.annotations.ApiModel;
import javax.persistence.Table;
import com.github.foxnic.sql.meta.DBTable;
import com.dt.platform.constants.db.OaTables.OA_FIN_REIMBURSE_APPLY;
import javax.persistence.Id;
import io.swagger.annotations.ApiModelProperty;
import java.math.BigDecimal;
import java.util.Date;
import javax.persistence.Transient;
import com.github.foxnic.api.swagger.EnumFor;
import org.github.foxnic.web.domain.hrm.Employee;
import org.github.foxnic.web.domain.bpm.ProcessInstance;
import java.util.List;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.github.foxnic.commons.lang.DataParser;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Map;
import com.github.foxnic.dao.entity.EntityContext;
import com.dt.platform.domain.oa.meta.FinReimburseApplyMeta;
import com.github.foxnic.sql.data.ExprRcd;



/**
 * 报销管理
 * <p>报销管理 , 数据表 oa_fin_reimburse_apply 的PO类型</p>
 * @author 金杰 , maillank@qq.com
 * @since 2025-06-23 10:19:47
 * @sign B52AE3B5FB1573CD5579BE952C0C4134
 * 此文件由工具自动生成，请勿修改。若表结构或配置发生变动，请使用工具重新生成。
*/

@Table(name = "oa_fin_reimburse_apply")
@ApiModel(description = "报销管理 ; 报销管理 , 数据表 oa_fin_reimburse_apply 的PO类型")
public class FinReimburseApply extends Entity {

	private static final long serialVersionUID = 1L;

	public static final DBTable TABLE =OA_FIN_REIMBURSE_APPLY.$TABLE;
	
	/**
	 * 主键：主键
	*/
	@Id
	@ApiModelProperty(required = true,value="主键" , notes = "主键" , example = "700939049640132613")
	private String id;
	
	/**
	 * 单据编号：单据编号
	*/
	@ApiModelProperty(required = false,value="单据编号" , notes = "单据编号" , example = "O8Cx#gdV5S")
	private String businessCode;
	
	/**
	 * 单据名称：单据名称
	*/
	@ApiModelProperty(required = false,value="单据名称" , notes = "单据名称" , example = "报销申请-20250607")
	private String name;
	
	/**
	 * 流程状态：流程状态
	*/
	@ApiModelProperty(required = false,value="流程状态" , notes = "流程状态" , example = "incomplete")
	private String status;
	
	/**
	 * 报销主体：报销主体
	*/
	@ApiModelProperty(required = false,value="报销主体" , notes = "报销主体" , example = "700771698256904197")
	private String subject;
	
	/**
	 * 报销金额：报销金额
	*/
	@ApiModelProperty(required = false,value="报销金额" , notes = "报销金额" , example = "12.00")
	private BigDecimal amount;
	
	/**
	 * 单据日期：单据日期
	*/
	@ApiModelProperty(required = false,value="单据日期" , notes = "单据日期" , example = "2025-06-07 12:00:00")
	private Date businessDate;
	
	/**
	 * 关联项目：关联项目
	*/
	@ApiModelProperty(required = false,value="关联项目" , notes = "关联项目")
	private String projectId;
	
	/**
	 * 附件：附件
	*/
	@ApiModelProperty(required = false,value="附件" , notes = "附件")
	private String fileIds;
	
	/**
	 * 申请人员：申请人员
	*/
	@ApiModelProperty(required = false,value="申请人员" , notes = "申请人员" , example = "E001")
	private String originatorId;
	
	/**
	 * 备注：备注
	*/
	@ApiModelProperty(required = false,value="备注" , notes = "备注")
	private String notes;
	
	/**
	 * 报销状态：报销状态
	*/
	@ApiModelProperty(required = false,value="报销状态" , notes = "报销状态")
	private String reimburseStatus;
	
	/**
	 * 打款时间：打款时间
	*/
	@ApiModelProperty(required = false,value="打款时间" , notes = "打款时间")
	private Date paymentTime;
	
	/**
	 * 打款人员：打款人员
	*/
	@ApiModelProperty(required = false,value="打款人员" , notes = "打款人员")
	private String paymentUserId;
	
	/**
	 * 打款备注：打款备注
	*/
	@ApiModelProperty(required = false,value="打款备注" , notes = "打款备注")
	private String paymentNotes;
	
	/**
	 * 创建人ID：创建人ID
	*/
	@ApiModelProperty(required = false,value="创建人ID" , notes = "创建人ID" , example = "110588348101165911")
	private String createBy;
	
	/**
	 * 创建时间：创建时间
	*/
	@ApiModelProperty(required = false,value="创建时间" , notes = "创建时间" , example = "2025-06-07 07:41:34")
	private Date createTime;
	
	/**
	 * 修改人ID：修改人ID
	*/
	@ApiModelProperty(required = false,value="修改人ID" , notes = "修改人ID" , example = "110588348101165911")
	private String updateBy;
	
	/**
	 * 修改时间：修改时间
	*/
	@ApiModelProperty(required = false,value="修改时间" , notes = "修改时间" , example = "2025-06-07 08:11:36")
	private Date updateTime;
	
	/**
	 * 是否已删除：是否已删除
	*/
	@ApiModelProperty(required = true,value="是否已删除" , notes = "是否已删除" , example = "0")
	private Integer deleted;
	@Transient
	@EnumFor("deleted")
	private Boolean deletedBool;
	
	/**
	 * 删除人ID：删除人ID
	*/
	@ApiModelProperty(required = false,value="删除人ID" , notes = "删除人ID")
	private String deleteBy;
	
	/**
	 * 删除时间：删除时间
	*/
	@ApiModelProperty(required = false,value="删除时间" , notes = "删除时间")
	private Date deleteTime;
	
	/**
	 * 数据版本号：数据版本号
	*/
	@ApiModelProperty(required = true,value="数据版本号" , notes = "数据版本号" , example = "2")
	private Integer version;
	
	/**
	 * 租户：租户
	*/
	@ApiModelProperty(required = false,value="租户" , notes = "租户" , example = "T001")
	private String tenantId;
	
	/**
	 * paymentUser：paymentUser
	*/
	@ApiModelProperty(required = false,value="paymentUser" , notes = "paymentUser")
	private Employee paymentUser;
	
	/**
	 * originator：originator
	*/
	@ApiModelProperty(required = false,value="originator" , notes = "originator")
	private Employee originator;
	
	/**
	 * companySubject：companySubject
	*/
	@ApiModelProperty(required = false,value="companySubject" , notes = "companySubject")
	private FinCompanySubject companySubject;
	
	/**
	 * selectedCode：selectedCode
	*/
	@ApiModelProperty(required = false,value="selectedCode" , notes = "selectedCode")
	private String selectedCode;
	
	/**
	 * project：project
	*/
	@ApiModelProperty(required = false,value="project" , notes = "project")
	private Project project;
	
	/**
	 * 历史流程清单：历史流程清单
	*/
	@ApiModelProperty(required = false,value="历史流程清单" , notes = "历史流程清单")
	private List<ProcessInstance> historicProcessList;
	
	/**
	 * 在批的流程清单：在批的流程清单
	*/
	@ApiModelProperty(required = false,value="在批的流程清单" , notes = "在批的流程清单")
	private List<ProcessInstance> currentProcessList;
	
	/**
	 * 默认流程：优先取在批的流程
	*/
	@ApiModelProperty(required = false,value="默认流程" , notes = "优先取在批的流程")
	private ProcessInstance defaultProcess;
	
	/**
	 * 获得 主键<br>
	 * 主键
	 * @return 主键
	*/
	public String getId() {
		return id;
	}
	
	/**
	 * 设置 主键
	 * @param id 主键
	 * @return 当前对象
	*/
	public FinReimburseApply setId(String id) {
		this.id=id;
		return this;
	}
	
	/**
	 * 获得 单据编号<br>
	 * 单据编号
	 * @return 单据编号
	*/
	public String getBusinessCode() {
		return businessCode;
	}
	
	/**
	 * 设置 单据编号
	 * @param businessCode 单据编号
	 * @return 当前对象
	*/
	public FinReimburseApply setBusinessCode(String businessCode) {
		this.businessCode=businessCode;
		return this;
	}
	
	/**
	 * 获得 单据名称<br>
	 * 单据名称
	 * @return 单据名称
	*/
	public String getName() {
		return name;
	}
	
	/**
	 * 设置 单据名称
	 * @param name 单据名称
	 * @return 当前对象
	*/
	public FinReimburseApply setName(String name) {
		this.name=name;
		return this;
	}
	
	/**
	 * 获得 流程状态<br>
	 * 流程状态
	 * @return 流程状态
	*/
	public String getStatus() {
		return status;
	}
	
	/**
	 * 设置 流程状态
	 * @param status 流程状态
	 * @return 当前对象
	*/
	public FinReimburseApply setStatus(String status) {
		this.status=status;
		return this;
	}
	
	/**
	 * 获得 报销主体<br>
	 * 报销主体
	 * @return 报销主体
	*/
	public String getSubject() {
		return subject;
	}
	
	/**
	 * 设置 报销主体
	 * @param subject 报销主体
	 * @return 当前对象
	*/
	public FinReimburseApply setSubject(String subject) {
		this.subject=subject;
		return this;
	}
	
	/**
	 * 获得 报销金额<br>
	 * 报销金额
	 * @return 报销金额
	*/
	public BigDecimal getAmount() {
		return amount;
	}
	
	/**
	 * 设置 报销金额
	 * @param amount 报销金额
	 * @return 当前对象
	*/
	public FinReimburseApply setAmount(BigDecimal amount) {
		this.amount=amount;
		return this;
	}
	
	/**
	 * 获得 单据日期<br>
	 * 单据日期
	 * @return 单据日期
	*/
	public Date getBusinessDate() {
		return businessDate;
	}
	
	/**
	 * 设置 单据日期
	 * @param businessDate 单据日期
	 * @return 当前对象
	*/
	public FinReimburseApply setBusinessDate(Date businessDate) {
		this.businessDate=businessDate;
		return this;
	}
	
	/**
	 * 获得 关联项目<br>
	 * 关联项目
	 * @return 关联项目
	*/
	public String getProjectId() {
		return projectId;
	}
	
	/**
	 * 设置 关联项目
	 * @param projectId 关联项目
	 * @return 当前对象
	*/
	public FinReimburseApply setProjectId(String projectId) {
		this.projectId=projectId;
		return this;
	}
	
	/**
	 * 获得 附件<br>
	 * 附件
	 * @return 附件
	*/
	public String getFileIds() {
		return fileIds;
	}
	
	/**
	 * 设置 附件
	 * @param fileIds 附件
	 * @return 当前对象
	*/
	public FinReimburseApply setFileIds(String fileIds) {
		this.fileIds=fileIds;
		return this;
	}
	
	/**
	 * 获得 申请人员<br>
	 * 申请人员
	 * @return 申请人员
	*/
	public String getOriginatorId() {
		return originatorId;
	}
	
	/**
	 * 设置 申请人员
	 * @param originatorId 申请人员
	 * @return 当前对象
	*/
	public FinReimburseApply setOriginatorId(String originatorId) {
		this.originatorId=originatorId;
		return this;
	}
	
	/**
	 * 获得 备注<br>
	 * 备注
	 * @return 备注
	*/
	public String getNotes() {
		return notes;
	}
	
	/**
	 * 设置 备注
	 * @param notes 备注
	 * @return 当前对象
	*/
	public FinReimburseApply setNotes(String notes) {
		this.notes=notes;
		return this;
	}
	
	/**
	 * 获得 报销状态<br>
	 * 报销状态
	 * @return 报销状态
	*/
	public String getReimburseStatus() {
		return reimburseStatus;
	}
	
	/**
	 * 设置 报销状态
	 * @param reimburseStatus 报销状态
	 * @return 当前对象
	*/
	public FinReimburseApply setReimburseStatus(String reimburseStatus) {
		this.reimburseStatus=reimburseStatus;
		return this;
	}
	
	/**
	 * 获得 打款时间<br>
	 * 打款时间
	 * @return 打款时间
	*/
	public Date getPaymentTime() {
		return paymentTime;
	}
	
	/**
	 * 设置 打款时间
	 * @param paymentTime 打款时间
	 * @return 当前对象
	*/
	public FinReimburseApply setPaymentTime(Date paymentTime) {
		this.paymentTime=paymentTime;
		return this;
	}
	
	/**
	 * 获得 打款人员<br>
	 * 打款人员
	 * @return 打款人员
	*/
	public String getPaymentUserId() {
		return paymentUserId;
	}
	
	/**
	 * 设置 打款人员
	 * @param paymentUserId 打款人员
	 * @return 当前对象
	*/
	public FinReimburseApply setPaymentUserId(String paymentUserId) {
		this.paymentUserId=paymentUserId;
		return this;
	}
	
	/**
	 * 获得 打款备注<br>
	 * 打款备注
	 * @return 打款备注
	*/
	public String getPaymentNotes() {
		return paymentNotes;
	}
	
	/**
	 * 设置 打款备注
	 * @param paymentNotes 打款备注
	 * @return 当前对象
	*/
	public FinReimburseApply setPaymentNotes(String paymentNotes) {
		this.paymentNotes=paymentNotes;
		return this;
	}
	
	/**
	 * 获得 创建人ID<br>
	 * 创建人ID
	 * @return 创建人ID
	*/
	public String getCreateBy() {
		return createBy;
	}
	
	/**
	 * 设置 创建人ID
	 * @param createBy 创建人ID
	 * @return 当前对象
	*/
	public FinReimburseApply setCreateBy(String createBy) {
		this.createBy=createBy;
		return this;
	}
	
	/**
	 * 获得 创建时间<br>
	 * 创建时间
	 * @return 创建时间
	*/
	public Date getCreateTime() {
		return createTime;
	}
	
	/**
	 * 设置 创建时间
	 * @param createTime 创建时间
	 * @return 当前对象
	*/
	public FinReimburseApply setCreateTime(Date createTime) {
		this.createTime=createTime;
		return this;
	}
	
	/**
	 * 获得 修改人ID<br>
	 * 修改人ID
	 * @return 修改人ID
	*/
	public String getUpdateBy() {
		return updateBy;
	}
	
	/**
	 * 设置 修改人ID
	 * @param updateBy 修改人ID
	 * @return 当前对象
	*/
	public FinReimburseApply setUpdateBy(String updateBy) {
		this.updateBy=updateBy;
		return this;
	}
	
	/**
	 * 获得 修改时间<br>
	 * 修改时间
	 * @return 修改时间
	*/
	public Date getUpdateTime() {
		return updateTime;
	}
	
	/**
	 * 设置 修改时间
	 * @param updateTime 修改时间
	 * @return 当前对象
	*/
	public FinReimburseApply setUpdateTime(Date updateTime) {
		this.updateTime=updateTime;
		return this;
	}
	
	/**
	 * 获得 是否已删除<br>
	 * 是否已删除
	 * @return 是否已删除
	*/
	public Integer getDeleted() {
		return deleted;
	}
	
	/**
	 * 获得 是否已删除 的投影属性<br>
	 * 等价于 getDeleted 方法，获得对应的枚举类型
	 * @return 是否已删除
	*/
	@Transient
	public Boolean isDeleted() {
		if(this.deletedBool==null) {
			this.deletedBool=DataParser.parseBoolean(deleted);
		}
		return this.deletedBool ;
	}
	
	/**
	 * 设置 是否已删除
	 * @param deleted 是否已删除
	 * @return 当前对象
	*/
	@JsonProperty("deleted")
	public FinReimburseApply setDeleted(Integer deleted) {
		this.deleted=deleted;
		this.deletedBool=DataParser.parseBoolean(deleted);
		return this;
	}
	
	/**
	 * 设置 是否已删除的投影属性，等同于设置 是否已删除
	 * @param deletedBool 是否已删除
	 * @return 当前对象
	*/
	@Transient
	public FinReimburseApply setDeleted(Boolean deletedBool) {
		if(deletedBool==null) {
			this.deleted=null;
		} else {
			this.deleted=deletedBool?1:0;
		}
		this.deletedBool=deletedBool;
		return this;
	}
	
	/**
	 * 获得 删除人ID<br>
	 * 删除人ID
	 * @return 删除人ID
	*/
	public String getDeleteBy() {
		return deleteBy;
	}
	
	/**
	 * 设置 删除人ID
	 * @param deleteBy 删除人ID
	 * @return 当前对象
	*/
	public FinReimburseApply setDeleteBy(String deleteBy) {
		this.deleteBy=deleteBy;
		return this;
	}
	
	/**
	 * 获得 删除时间<br>
	 * 删除时间
	 * @return 删除时间
	*/
	public Date getDeleteTime() {
		return deleteTime;
	}
	
	/**
	 * 设置 删除时间
	 * @param deleteTime 删除时间
	 * @return 当前对象
	*/
	public FinReimburseApply setDeleteTime(Date deleteTime) {
		this.deleteTime=deleteTime;
		return this;
	}
	
	/**
	 * 获得 数据版本号<br>
	 * 数据版本号
	 * @return 数据版本号
	*/
	public Integer getVersion() {
		return version;
	}
	
	/**
	 * 设置 数据版本号
	 * @param version 数据版本号
	 * @return 当前对象
	*/
	public FinReimburseApply setVersion(Integer version) {
		this.version=version;
		return this;
	}
	
	/**
	 * 获得 租户<br>
	 * 租户
	 * @return 租户
	*/
	public String getTenantId() {
		return tenantId;
	}
	
	/**
	 * 设置 租户
	 * @param tenantId 租户
	 * @return 当前对象
	*/
	public FinReimburseApply setTenantId(String tenantId) {
		this.tenantId=tenantId;
		return this;
	}
	
	/**
	 * 获得 paymentUser<br>
	 * paymentUser
	 * @return paymentUser
	*/
	public Employee getPaymentUser() {
		return paymentUser;
	}
	
	/**
	 * 设置 paymentUser
	 * @param paymentUser paymentUser
	 * @return 当前对象
	*/
	public FinReimburseApply setPaymentUser(Employee paymentUser) {
		this.paymentUser=paymentUser;
		return this;
	}
	
	/**
	 * 获得 originator<br>
	 * originator
	 * @return originator
	*/
	public Employee getOriginator() {
		return originator;
	}
	
	/**
	 * 设置 originator
	 * @param originator originator
	 * @return 当前对象
	*/
	public FinReimburseApply setOriginator(Employee originator) {
		this.originator=originator;
		return this;
	}
	
	/**
	 * 获得 companySubject<br>
	 * companySubject
	 * @return companySubject
	*/
	public FinCompanySubject getCompanySubject() {
		return companySubject;
	}
	
	/**
	 * 设置 companySubject
	 * @param companySubject companySubject
	 * @return 当前对象
	*/
	public FinReimburseApply setCompanySubject(FinCompanySubject companySubject) {
		this.companySubject=companySubject;
		return this;
	}
	
	/**
	 * 获得 selectedCode<br>
	 * selectedCode
	 * @return selectedCode
	*/
	public String getSelectedCode() {
		return selectedCode;
	}
	
	/**
	 * 设置 selectedCode
	 * @param selectedCode selectedCode
	 * @return 当前对象
	*/
	public FinReimburseApply setSelectedCode(String selectedCode) {
		this.selectedCode=selectedCode;
		return this;
	}
	
	/**
	 * 获得 project<br>
	 * project
	 * @return project
	*/
	public Project getProject() {
		return project;
	}
	
	/**
	 * 设置 project
	 * @param project project
	 * @return 当前对象
	*/
	public FinReimburseApply setProject(Project project) {
		this.project=project;
		return this;
	}
	
	/**
	 * 获得 历史流程清单<br>
	 * 历史流程清单
	 * @return 历史流程清单
	*/
	public List<ProcessInstance> getHistoricProcessList() {
		return historicProcessList;
	}
	
	/**
	 * 设置 历史流程清单
	 * @param historicProcessList 历史流程清单
	 * @return 当前对象
	*/
	public FinReimburseApply setHistoricProcessList(List<ProcessInstance> historicProcessList) {
		this.historicProcessList=historicProcessList;
		return this;
	}
	
	/**
	 * 添加 历史流程清单
	 * @param historicProcess 历史流程清单
	 * @return 当前对象
	*/
	public FinReimburseApply addHistoricProcess(ProcessInstance... historicProcess) {
		if(this.historicProcessList==null) {
			historicProcessList=new ArrayList<>();
		}
		this.historicProcessList.addAll(Arrays.asList(historicProcess));
		return this;
	}
	
	/**
	 * 获得 在批的流程清单<br>
	 * 在批的流程清单
	 * @return 在批的流程清单
	*/
	public List<ProcessInstance> getCurrentProcessList() {
		return currentProcessList;
	}
	
	/**
	 * 设置 在批的流程清单
	 * @param currentProcessList 在批的流程清单
	 * @return 当前对象
	*/
	public FinReimburseApply setCurrentProcessList(List<ProcessInstance> currentProcessList) {
		this.currentProcessList=currentProcessList;
		return this;
	}
	
	/**
	 * 添加 在批的流程清单
	 * @param currentProcess 在批的流程清单
	 * @return 当前对象
	*/
	public FinReimburseApply addCurrentProcess(ProcessInstance... currentProcess) {
		if(this.currentProcessList==null) {
			currentProcessList=new ArrayList<>();
		}
		this.currentProcessList.addAll(Arrays.asList(currentProcess));
		return this;
	}
	
	/**
	 * 获得 默认流程<br>
	 * 优先取在批的流程
	 * @return 默认流程
	*/
	public ProcessInstance getDefaultProcess() {
		return defaultProcess;
	}
	
	/**
	 * 设置 默认流程
	 * @param defaultProcess 默认流程
	 * @return 当前对象
	*/
	public FinReimburseApply setDefaultProcess(ProcessInstance defaultProcess) {
		this.defaultProcess=defaultProcess;
		return this;
	}

	/**
	 * 将自己转换成指定类型的PO
	 * @param poType  PO类型
	 * @return FinReimburseApply , 转换好的 FinReimburseApply 对象
	*/
	@Transient
	public <T extends Entity> T toPO(Class<T> poType) {
		return EntityContext.create(poType, this);
	}

	/**
	 * 将自己转换成任意指定类型
	 * @param pojoType  Pojo类型
	 * @return FinReimburseApply , 转换好的 PoJo 对象
	*/
	@Transient
	public <T> T toPojo(Class<T> pojoType) {
		if(Entity.class.isAssignableFrom(pojoType)) {
			return (T)this.toPO((Class<Entity>)pojoType);
		}
		try {
			T pojo=pojoType.newInstance();
			EntityContext.copyProperties(pojo, this);
			return pojo;
		} catch (Exception e) {
			throw new RuntimeException(e);
		}
	}

	/**
	 * 克隆当前对象
	*/
	@Transient
	public FinReimburseApply clone() {
		return duplicate(true);
	}

	/**
	 * 复制当前对象
	 * @param all 是否复制全部属性，当 false 时，仅复制来自数据表的属性
	*/
	@Transient
	public FinReimburseApply duplicate(boolean all) {
		com.dt.platform.domain.oa.meta.FinReimburseApplyMeta.$$proxy$$ inst = new com.dt.platform.domain.oa.meta.FinReimburseApplyMeta.$$proxy$$();
		inst.setAmount(this.getAmount());
		inst.setNotes(this.getNotes());
		inst.setSubject(this.getSubject());
		inst.setPaymentUserId(this.getPaymentUserId());
		inst.setUpdateTime(this.getUpdateTime());
		inst.setVersion(this.getVersion());
		inst.setReimburseStatus(this.getReimburseStatus());
		inst.setBusinessDate(this.getBusinessDate());
		inst.setBusinessCode(this.getBusinessCode());
		inst.setCreateBy(this.getCreateBy());
		inst.setDeleted(this.getDeleted());
		inst.setPaymentNotes(this.getPaymentNotes());
		inst.setFileIds(this.getFileIds());
		inst.setCreateTime(this.getCreateTime());
		inst.setUpdateBy(this.getUpdateBy());
		inst.setDeleteTime(this.getDeleteTime());
		inst.setName(this.getName());
		inst.setTenantId(this.getTenantId());
		inst.setDeleteBy(this.getDeleteBy());
		inst.setId(this.getId());
		inst.setOriginatorId(this.getOriginatorId());
		inst.setPaymentTime(this.getPaymentTime());
		inst.setProjectId(this.getProjectId());
		inst.setStatus(this.getStatus());
		if(all) {
			inst.setPaymentUser(this.getPaymentUser());
			inst.setProject(this.getProject());
			inst.setHistoricProcessList(this.getHistoricProcessList());
			inst.setOriginator(this.getOriginator());
			inst.setCompanySubject(this.getCompanySubject());
			inst.setSelectedCode(this.getSelectedCode());
			inst.setCurrentProcessList(this.getCurrentProcessList());
			inst.setDefaultProcess(this.getDefaultProcess());
		}
		inst.clearModifies();
		return inst;
	}

	/**
	 * 克隆当前对象
	*/
	@Transient
	public FinReimburseApply clone(boolean deep) {
		return EntityContext.clone(FinReimburseApply.class,this,deep);
	}

	/**
	 * 将 Map 转换成 FinReimburseApply
	 * @param finReimburseApplyMap 包含实体信息的 Map 对象
	 * @return FinReimburseApply , 转换好的的 FinReimburseApply 对象
	*/
	@Transient
	public static FinReimburseApply createFrom(Map<String,Object> finReimburseApplyMap) {
		if(finReimburseApplyMap==null) return null;
		FinReimburseApply po = create();
		EntityContext.copyProperties(po,finReimburseApplyMap);
		po.clearModifies();
		return po;
	}

	/**
	 * 将 Pojo 转换成 FinReimburseApply
	 * @param pojo 包含实体信息的 Pojo 对象
	 * @return FinReimburseApply , 转换好的的 FinReimburseApply 对象
	*/
	@Transient
	public static FinReimburseApply createFrom(Object pojo) {
		if(pojo==null) return null;
		FinReimburseApply po = create();
		EntityContext.copyProperties(po,pojo);
		po.clearModifies();
		return po;
	}

	/**
	 * 创建一个 FinReimburseApply，等同于 new
	 * @return FinReimburseApply 对象
	*/
	@Transient
	public static FinReimburseApply create() {
		return new com.dt.platform.domain.oa.meta.FinReimburseApplyMeta.$$proxy$$();
	}

	/**
	 * 从 Map 读取
	 * @param map 记录数据
	 * @param cast 是否用 DataParser 进行类型转换
	 * @return  是否读取成功
	*/
	public boolean read(Map<String, Object> map,boolean cast) {
		if(map==null) return false;
		if(cast) {
			this.setAmount(DataParser.parse(BigDecimal.class, map.get(FinReimburseApplyMeta.AMOUNT)));
			this.setNotes(DataParser.parse(String.class, map.get(FinReimburseApplyMeta.NOTES)));
			this.setSubject(DataParser.parse(String.class, map.get(FinReimburseApplyMeta.SUBJECT)));
			this.setPaymentUserId(DataParser.parse(String.class, map.get(FinReimburseApplyMeta.PAYMENT_USER_ID)));
			this.setUpdateTime(DataParser.parse(Date.class, map.get(FinReimburseApplyMeta.UPDATE_TIME)));
			this.setVersion(DataParser.parse(Integer.class, map.get(FinReimburseApplyMeta.VERSION)));
			this.setReimburseStatus(DataParser.parse(String.class, map.get(FinReimburseApplyMeta.REIMBURSE_STATUS)));
			this.setBusinessDate(DataParser.parse(Date.class, map.get(FinReimburseApplyMeta.BUSINESS_DATE)));
			this.setBusinessCode(DataParser.parse(String.class, map.get(FinReimburseApplyMeta.BUSINESS_CODE)));
			this.setCreateBy(DataParser.parse(String.class, map.get(FinReimburseApplyMeta.CREATE_BY)));
			this.setDeleted(DataParser.parse(Integer.class, map.get(FinReimburseApplyMeta.DELETED)));
			this.setPaymentNotes(DataParser.parse(String.class, map.get(FinReimburseApplyMeta.PAYMENT_NOTES)));
			this.setFileIds(DataParser.parse(String.class, map.get(FinReimburseApplyMeta.FILE_IDS)));
			this.setCreateTime(DataParser.parse(Date.class, map.get(FinReimburseApplyMeta.CREATE_TIME)));
			this.setUpdateBy(DataParser.parse(String.class, map.get(FinReimburseApplyMeta.UPDATE_BY)));
			this.setDeleteTime(DataParser.parse(Date.class, map.get(FinReimburseApplyMeta.DELETE_TIME)));
			this.setName(DataParser.parse(String.class, map.get(FinReimburseApplyMeta.NAME)));
			this.setTenantId(DataParser.parse(String.class, map.get(FinReimburseApplyMeta.TENANT_ID)));
			this.setDeleteBy(DataParser.parse(String.class, map.get(FinReimburseApplyMeta.DELETE_BY)));
			this.setId(DataParser.parse(String.class, map.get(FinReimburseApplyMeta.ID)));
			this.setOriginatorId(DataParser.parse(String.class, map.get(FinReimburseApplyMeta.ORIGINATOR_ID)));
			this.setPaymentTime(DataParser.parse(Date.class, map.get(FinReimburseApplyMeta.PAYMENT_TIME)));
			this.setProjectId(DataParser.parse(String.class, map.get(FinReimburseApplyMeta.PROJECT_ID)));
			this.setStatus(DataParser.parse(String.class, map.get(FinReimburseApplyMeta.STATUS)));
			// others
			this.setPaymentUser(DataParser.parse(Employee.class, map.get(FinReimburseApplyMeta.PAYMENT_USER)));
			this.setProject(DataParser.parse(Project.class, map.get(FinReimburseApplyMeta.PROJECT)));
			this.setOriginator(DataParser.parse(Employee.class, map.get(FinReimburseApplyMeta.ORIGINATOR)));
			this.setCompanySubject(DataParser.parse(FinCompanySubject.class, map.get(FinReimburseApplyMeta.COMPANY_SUBJECT)));
			this.setSelectedCode(DataParser.parse(String.class, map.get(FinReimburseApplyMeta.SELECTED_CODE)));
			this.setDefaultProcess(DataParser.parse(ProcessInstance.class, map.get(FinReimburseApplyMeta.DEFAULT_PROCESS)));
			return true;
		} else {
			try {
				this.setAmount( (BigDecimal)map.get(FinReimburseApplyMeta.AMOUNT));
				this.setNotes( (String)map.get(FinReimburseApplyMeta.NOTES));
				this.setSubject( (String)map.get(FinReimburseApplyMeta.SUBJECT));
				this.setPaymentUserId( (String)map.get(FinReimburseApplyMeta.PAYMENT_USER_ID));
				this.setUpdateTime( (Date)map.get(FinReimburseApplyMeta.UPDATE_TIME));
				this.setVersion( (Integer)map.get(FinReimburseApplyMeta.VERSION));
				this.setReimburseStatus( (String)map.get(FinReimburseApplyMeta.REIMBURSE_STATUS));
				this.setBusinessDate( (Date)map.get(FinReimburseApplyMeta.BUSINESS_DATE));
				this.setBusinessCode( (String)map.get(FinReimburseApplyMeta.BUSINESS_CODE));
				this.setCreateBy( (String)map.get(FinReimburseApplyMeta.CREATE_BY));
				this.setDeleted( (Integer)map.get(FinReimburseApplyMeta.DELETED));
				this.setPaymentNotes( (String)map.get(FinReimburseApplyMeta.PAYMENT_NOTES));
				this.setFileIds( (String)map.get(FinReimburseApplyMeta.FILE_IDS));
				this.setCreateTime( (Date)map.get(FinReimburseApplyMeta.CREATE_TIME));
				this.setUpdateBy( (String)map.get(FinReimburseApplyMeta.UPDATE_BY));
				this.setDeleteTime( (Date)map.get(FinReimburseApplyMeta.DELETE_TIME));
				this.setName( (String)map.get(FinReimburseApplyMeta.NAME));
				this.setTenantId( (String)map.get(FinReimburseApplyMeta.TENANT_ID));
				this.setDeleteBy( (String)map.get(FinReimburseApplyMeta.DELETE_BY));
				this.setId( (String)map.get(FinReimburseApplyMeta.ID));
				this.setOriginatorId( (String)map.get(FinReimburseApplyMeta.ORIGINATOR_ID));
				this.setPaymentTime( (Date)map.get(FinReimburseApplyMeta.PAYMENT_TIME));
				this.setProjectId( (String)map.get(FinReimburseApplyMeta.PROJECT_ID));
				this.setStatus( (String)map.get(FinReimburseApplyMeta.STATUS));
				// others
				this.setPaymentUser( (Employee)map.get(FinReimburseApplyMeta.PAYMENT_USER));
				this.setProject( (Project)map.get(FinReimburseApplyMeta.PROJECT));
				this.setOriginator( (Employee)map.get(FinReimburseApplyMeta.ORIGINATOR));
				this.setCompanySubject( (FinCompanySubject)map.get(FinReimburseApplyMeta.COMPANY_SUBJECT));
				this.setSelectedCode( (String)map.get(FinReimburseApplyMeta.SELECTED_CODE));
				this.setDefaultProcess( (ProcessInstance)map.get(FinReimburseApplyMeta.DEFAULT_PROCESS));
				return true;
			} catch (Exception e) {
				return false;
			}
		}
	}

	/**
	 * 从 Map 读取
	 * @param r 记录数据
	 * @param cast 是否用 DataParser 进行类型转换
	 * @return  是否读取成功
	*/
	public boolean read(ExprRcd r,boolean cast) {
		if(r==null) return false;
		if(cast) {
			this.setAmount(DataParser.parse(BigDecimal.class, r.getValue(FinReimburseApplyMeta.AMOUNT)));
			this.setNotes(DataParser.parse(String.class, r.getValue(FinReimburseApplyMeta.NOTES)));
			this.setSubject(DataParser.parse(String.class, r.getValue(FinReimburseApplyMeta.SUBJECT)));
			this.setPaymentUserId(DataParser.parse(String.class, r.getValue(FinReimburseApplyMeta.PAYMENT_USER_ID)));
			this.setUpdateTime(DataParser.parse(Date.class, r.getValue(FinReimburseApplyMeta.UPDATE_TIME)));
			this.setVersion(DataParser.parse(Integer.class, r.getValue(FinReimburseApplyMeta.VERSION)));
			this.setReimburseStatus(DataParser.parse(String.class, r.getValue(FinReimburseApplyMeta.REIMBURSE_STATUS)));
			this.setBusinessDate(DataParser.parse(Date.class, r.getValue(FinReimburseApplyMeta.BUSINESS_DATE)));
			this.setBusinessCode(DataParser.parse(String.class, r.getValue(FinReimburseApplyMeta.BUSINESS_CODE)));
			this.setCreateBy(DataParser.parse(String.class, r.getValue(FinReimburseApplyMeta.CREATE_BY)));
			this.setDeleted(DataParser.parse(Integer.class, r.getValue(FinReimburseApplyMeta.DELETED)));
			this.setPaymentNotes(DataParser.parse(String.class, r.getValue(FinReimburseApplyMeta.PAYMENT_NOTES)));
			this.setFileIds(DataParser.parse(String.class, r.getValue(FinReimburseApplyMeta.FILE_IDS)));
			this.setCreateTime(DataParser.parse(Date.class, r.getValue(FinReimburseApplyMeta.CREATE_TIME)));
			this.setUpdateBy(DataParser.parse(String.class, r.getValue(FinReimburseApplyMeta.UPDATE_BY)));
			this.setDeleteTime(DataParser.parse(Date.class, r.getValue(FinReimburseApplyMeta.DELETE_TIME)));
			this.setName(DataParser.parse(String.class, r.getValue(FinReimburseApplyMeta.NAME)));
			this.setTenantId(DataParser.parse(String.class, r.getValue(FinReimburseApplyMeta.TENANT_ID)));
			this.setDeleteBy(DataParser.parse(String.class, r.getValue(FinReimburseApplyMeta.DELETE_BY)));
			this.setId(DataParser.parse(String.class, r.getValue(FinReimburseApplyMeta.ID)));
			this.setOriginatorId(DataParser.parse(String.class, r.getValue(FinReimburseApplyMeta.ORIGINATOR_ID)));
			this.setPaymentTime(DataParser.parse(Date.class, r.getValue(FinReimburseApplyMeta.PAYMENT_TIME)));
			this.setProjectId(DataParser.parse(String.class, r.getValue(FinReimburseApplyMeta.PROJECT_ID)));
			this.setStatus(DataParser.parse(String.class, r.getValue(FinReimburseApplyMeta.STATUS)));
			return true;
		} else {
			try {
				this.setAmount( (BigDecimal)r.getValue(FinReimburseApplyMeta.AMOUNT));
				this.setNotes( (String)r.getValue(FinReimburseApplyMeta.NOTES));
				this.setSubject( (String)r.getValue(FinReimburseApplyMeta.SUBJECT));
				this.setPaymentUserId( (String)r.getValue(FinReimburseApplyMeta.PAYMENT_USER_ID));
				this.setUpdateTime( (Date)r.getValue(FinReimburseApplyMeta.UPDATE_TIME));
				this.setVersion( (Integer)r.getValue(FinReimburseApplyMeta.VERSION));
				this.setReimburseStatus( (String)r.getValue(FinReimburseApplyMeta.REIMBURSE_STATUS));
				this.setBusinessDate( (Date)r.getValue(FinReimburseApplyMeta.BUSINESS_DATE));
				this.setBusinessCode( (String)r.getValue(FinReimburseApplyMeta.BUSINESS_CODE));
				this.setCreateBy( (String)r.getValue(FinReimburseApplyMeta.CREATE_BY));
				this.setDeleted( (Integer)r.getValue(FinReimburseApplyMeta.DELETED));
				this.setPaymentNotes( (String)r.getValue(FinReimburseApplyMeta.PAYMENT_NOTES));
				this.setFileIds( (String)r.getValue(FinReimburseApplyMeta.FILE_IDS));
				this.setCreateTime( (Date)r.getValue(FinReimburseApplyMeta.CREATE_TIME));
				this.setUpdateBy( (String)r.getValue(FinReimburseApplyMeta.UPDATE_BY));
				this.setDeleteTime( (Date)r.getValue(FinReimburseApplyMeta.DELETE_TIME));
				this.setName( (String)r.getValue(FinReimburseApplyMeta.NAME));
				this.setTenantId( (String)r.getValue(FinReimburseApplyMeta.TENANT_ID));
				this.setDeleteBy( (String)r.getValue(FinReimburseApplyMeta.DELETE_BY));
				this.setId( (String)r.getValue(FinReimburseApplyMeta.ID));
				this.setOriginatorId( (String)r.getValue(FinReimburseApplyMeta.ORIGINATOR_ID));
				this.setPaymentTime( (Date)r.getValue(FinReimburseApplyMeta.PAYMENT_TIME));
				this.setProjectId( (String)r.getValue(FinReimburseApplyMeta.PROJECT_ID));
				this.setStatus( (String)r.getValue(FinReimburseApplyMeta.STATUS));
				return true;
			} catch (Exception e) {
				return false;
			}
		}
	}
}